package com.ophelisis.ibatis.handler;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.ophelisis.ibatis.SqlMapper;
import com.ophelisis.persistence.domain.BoardGeneralVO;

public class handler_board_general {
	/**
	 * 일반 게시판 관리 - 목록
	 */
	@SuppressWarnings("unchecked")
	public static List<BoardGeneralVO> getBoardGeneralList() throws SQLException {
		return SqlMapper.sqlMapClient.queryForList("board.getBoardGeneralList");
	}
	
	@SuppressWarnings("unchecked")
	public static List<BoardGeneralVO> getBoardGeneralList(Map<String, Object> params) throws SQLException {
		return SqlMapper.sqlMapClient.queryForList("board.getBoardGeneralList", params);
	}

	/**
	 * 일반 게시판 관리 - 목록 갯수
	 */
	public static Integer getBoardGeneralListCnt() throws SQLException {
		return (Integer)SqlMapper.sqlMapClient.queryForObject("board.getBoardGeneralListCnt");
	}
	
	public static Integer getBoardGeneralListCnt(Map<String, Object> params) throws SQLException {
		return (Integer)SqlMapper.sqlMapClient.queryForObject("board.getBoardGeneralListCnt", params);
	}

	/**
	 * 일반 게시판 관리 - 상세
	 */
	@SuppressWarnings("unchecked")
	public static List<BoardGeneralVO> getBoardGeneralDetail(Map<String, Object> params) throws SQLException {
		return SqlMapper.sqlMapClient.queryForList("board.getBoardGeneralDetail", params);
	}

	/**
	 * 일반 게시판 관리 - 삭제
	 */
	public static Integer setBoardGeneralDelete(Map<String, Object> params) throws SQLException {
		return (Integer)SqlMapper.sqlMapClient.update("board.setBoardGeneralDelete", params);
	}

	/**
	 * 일반 게시판 관리 - 완전 삭제
	 */
	public static Integer setBoardGeneralDeleteFinal(Map<String, Object> params) throws SQLException {
		return (Integer)SqlMapper.sqlMapClient.update("board.setBoardGeneralDeleteFinal", params);
	}

	/**
	 * 일반 게시판 관리 - 수정
	 */
	public static Integer setBoardGeneralModify(BoardGeneralVO paramVO) throws SQLException {
		return (Integer)SqlMapper.sqlMapClient.update("board.setBoardGeneralModify", paramVO);
	}

	/**
	 * 일반 게시판 관리 - 등록
	 */
	public static Integer setBoardGeneralAdd(BoardGeneralVO paramVO) throws SQLException {
		return (Integer)SqlMapper.sqlMapClient.update("board.setBoardGeneralAdd", paramVO);
	}

	/**
	 * 일반 게시판 관리 - 유무
	 */
	public static Integer existGeneral(Map<String, Object> params) throws SQLException {
		return (Integer)SqlMapper.sqlMapClient.queryForObject("board.existGeneral", params);
	}
}
